<?php
/**
 *
 */

namespace App\Services\Repositories\Product;

use App\Models\Panx\ProductTag;

class ProductTagRepository
{
    protected $product_tag;

    public function __construct()
    {
        $this->product_tag = new ProductTag;
    }
    /**
     * 根据不语言显示对应的标签
     *
     * @return array
     */
    public function getProductTags()
    {
        if (str_contains(config('app.locale'), 'en')) {
            $product_tags = $this->product_tag->latest()->pluck('const', 'id')->all();
        } else {
            $product_tags = $this->product_tag->latest()->pluck('name', 'id')->all();
        }
        return $product_tags;
    }
}